Optimal. Leaf size=78 \[ \frac {\sqrt {a} (2 A+B) \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {a B \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.086, Rules used = {4101, 3886,
221} \begin {gather*} \frac {\sqrt {a} (2 A+B) \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{d}+\frac {a B \sin (c+d x) \sec ^{\frac {3}{2}}(c+d x)}{d \sqrt {a \sec (c+d x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 221
Rule 3886
Rule 4101
Rubi steps
\begin {align*} \int \sqrt {\sec (c+d x)} \sqrt {a+a \sec (c+d x)} (A+B \sec (c+d x)) \, dx &=\frac {a B \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+\frac {1}{2} (2 A+B) \int \sqrt {\sec (c+d x)} \sqrt {a+a \sec (c+d x)} \, dx\\ &=\frac {a B \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}-\frac {(2 A+B) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{a}}} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}\\ &=\frac {\sqrt {a} (2 A+B) \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {a B \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.28, size = 89, normalized size = 1.14 \begin {gather*} \frac {\sec \left (\frac {1}{2} (c+d x)\right ) \sqrt {\sec (c+d x)} \sqrt {a (1+\sec (c+d x))} \left (\sqrt {2} (2 A+B) \tanh ^{-1}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right ) \cos (c+d x)+2 B \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(277\) vs.
\(2(68)=136\).
time = 8.00, size = 278, normalized size = 3.56
method | result | size |
default | \(\frac {\sqrt {\frac {1}{\cos \left (d x +c \right )}}\, \sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (2 A \cos \left (d x +c \right ) \sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (-1-\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right )+2 A \cos \left (d x +c \right ) \sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right )+B \cos \left (d x +c \right ) \sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (-1-\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right )+B \cos \left (d x +c \right ) \sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right )+2 B \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )\right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (\cos ^{2}\left (d x +c \right )-1\right )}{4 d \sin \left (d x +c \right )^{2}}\) | \(278\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 905 vs.
\(2 (68) = 136\).
time = 0.69, size = 905, normalized size = 11.60 \begin {gather*} \frac {2 \, A \sqrt {a} {\left (\log \left (2 \, \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2\right ) + \log \left (2 \, \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2\right )\right )} - \frac {{\left (4 \, \sqrt {2} \cos \left (\frac {3}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) \sin \left (2 \, d x + 2 \, c\right ) - 4 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) \sin \left (2 \, d x + 2 \, c\right ) - {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )} \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right ) + {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )} \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right ) - {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )} \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right ) + {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )} \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right ) - 4 \, {\left (\sqrt {2} \cos \left (2 \, d x + 2 \, c\right ) + \sqrt {2}\right )} \sin \left (\frac {3}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 4 \, {\left (\sqrt {2} \cos \left (2 \, d x + 2 \, c\right ) + \sqrt {2}\right )} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )\right )} B \sqrt {a}}{\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 144 vs.
\(2 (68) = 136\).
time = 1.58, size = 322, normalized size = 4.13 \begin {gather*} \left [\frac {{\left ({\left (2 \, A + B\right )} \cos \left (d x + c\right ) + 2 \, A + B\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - \frac {4 \, {\left (\cos \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right )\right )} \sqrt {a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}} + 8 \, a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}}\right ) + \frac {4 \, B \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{4 \, {\left (d \cos \left (d x + c\right ) + d\right )}}, \frac {{\left ({\left (2 \, A + B\right )} \cos \left (d x + c\right ) + 2 \, A + B\right )} \sqrt {-a} \arctan \left (\frac {2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{a \cos \left (d x + c\right )^{2} - a \cos \left (d x + c\right ) - 2 \, a}\right ) + \frac {2 \, B \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{2 \, {\left (d \cos \left (d x + c\right ) + d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \left (A + B \sec {\left (c + d x \right )}\right ) \sqrt {\sec {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \left (A+\frac {B}{\cos \left (c+d\,x\right )}\right )\,\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}\,\sqrt {\frac {1}{\cos \left (c+d\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________